<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImgUrl" alt="">
      <div class="banner-info">
        <div class="banner-title">大连圣亚海洋世界(AAAA景区)</div>
        <div class="banner-icon"><span class="iconfont">&#xe60b;</span>39</div>
      </div>
    </div>
    <fade-animation>
      <common-gallery :imgs="gallaryImgs" v-show="showGallery" @close="closeGallery"></common-gallery>
    </fade-animation>
  </div>
</template>

<script>
import CommonGallery from '@/common/gallery/Gallery'
import FadeAnimation from '@/common/fade/FadeAnimation'
export default {
  props: {
    bannerImgUrl: String,
    gallaryImgs: Array
  },
  data () {
    return {
      showGallery: false
    }
  },
  components: {
    CommonGallery,
    FadeAnimation
  },
  methods: {
    handleBannerClick () {
      this.showGallery = true
    },
    closeGallery () {
      this.showGallery = false
    }
  }
}
</script>

<style scoped lang="stylus">
  .banner
    overflow hidden
    height 0
    padding-bottom 55%
    position relative
    .banner-img
      width 100%
    .banner-info
      height .8rem
      display flex
      align-items center
      position absolute
      left 0
      right 0
      bottom 0
      font-size .28rem
      color #fff
      background-image linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))
      .banner-title
        flex 1
        padding 0 .16rem
      .banner-icon
        padding 0 .4rem
        height .4rem
        line-height .4rem
        margin .08rem .2rem 0
        background rgba(0, 0, 0, .8)
        border-radius .2rem
        span
          font-size .28rem
          padding-right .12rem
</style>
